﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class CreateUser : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        
    {
 
        Roles.AddUserToRole(CreateUserWizard1.UserName, "普通教师");
        string email = CreateUserWizard1.Email;
        string username=CreateUserWizard1.UserName;
        SqlDataSource1.InsertCommand = "insert into [zyk_Users]([User_ID],[User_Email],[User_Role]) values('"+username+"','"+email+"','A')";
        SqlDataSource1.Insert();
        SqlDataSource1.SelectCommand = "SELECT [User_Name], [User_School], [User_College], [User_Deparment], [User_TeacherNo], [User_Email], [User_Sex], [User_TelMobile], [User_TelHome], [User_Province], [User_City], [User_Address], [User_ID] FROM [zyk_Users] WHERE ([User_ID] = '"+username+"')";
   }
    protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {
        Response.Redirect("Manger_Default.aspx");
    }

}
